
#ifndef PROJECTZ_NUSER_NCOMMAND_CS_REQ_OPP_USER_INFO_DEFAULT_VILLIGE_H_
#define PROJECTZ_NUSER_NCOMMAND_CS_REQ_OPP_USER_INFO_DEFAULT_VILLIGE_H_

#include "../../engine.h"

#include "../../User.h"
#include "../../NLogic/Static.h"
#include "../../NLogic/Function.h"

namespace ProjectZ { namespace NCommand { namespace NWorld {

class CS_REQ_OPP_USER_INFO_DEFAULT_VILLAGE
{
public:
	static void OnExecute(User * pUser, ::Network::Packet * pPacket)
	{
		STRESSLOG("[CHANNEL] CS_REQ_OPP_USER_INFO_DEFAULT_VILLAGE::ONEXECUTE");

		PREPARE_PACKET;

		NLogic::Space * pSpace = pUser->GetSpace();
		if (NULL == pSpace)
			return;

		const NLogic::Space::USERTREE & clsUserTree = pSpace->GetUserTree();
		std::for_each(clsUserTree.begin(), clsUserTree.end(), [&](const std::pair<const int, ProjectZ::User*>& pair) {
			if (NULL != pair.second && pair.first != pUser->GetUserSeq())
			{
				NLogic::NFunction::SendCharacterInfoSimple(pUser, pair.second);
			}
		} );
	}
};

} /*NWorld*/ } /*NCommand*/ } /*ProjectZ*/


#endif /* PROJECTZ_NUSER_NCOMMAND_CS_REQ_OPP_USER_INFO_DEFAULT_VILLIGE_H_ */
